/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.hycreate.platform.modules.crm.project;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hycreate.platform.common.persistence.Page;
import com.hycreate.platform.common.service.CrudService;

/**
 * 消息回馈Service
 * @author hj
 * @version 2016-12-06
 */
@Service
@Transactional(readOnly = true)
public class HycrmRemindService extends CrudService<HycrmRemindDao, HycrmRemind> {

	public HycrmRemind get(String id) {
		return super.get(id);
	}
	
	public List<HycrmRemind> findList(HycrmRemind hycrmRemind) {
		return super.findList(hycrmRemind);
	}
	
	public Page<HycrmRemind> findPage(Page<HycrmRemind> page, HycrmRemind hycrmRemind) {
		return super.findPage(page, hycrmRemind);
	}
	
	
	@Transactional(readOnly = false)
	public void saveRemind(ProjectContact projectContact) {
		if (projectContact.getIsNewRecord()){
			projectContact.preInsert();
			dao.insert(projectContact);
		}else{
			projectContact.preUpdate();
			dao.update(projectContact);
		}
	}
	
	@Transactional(readOnly = false)
	public void saveReminds(HycrmRemind remind) {
		if (remind.getIsNewRecord()){
			remind.preInsert();
			
			dao.insertRemind(remind);
		}else{
			remind.preUpdate();
			dao.updateRemind(remind);
		}
	}
	@Transactional(readOnly = false)
	public void delete(HycrmRemind hycrmRemind) {
		super.delete(hycrmRemind);
	}
	
}